#include <iostream>
using namespace std;
int main()
{
    int i, a[10], x, m, n, j, mid;
    for (i = 0; i < 10; i++)
        cin >> a[i];
    for (i = 0; i < 10; i++)
    {
        for (j = 0; j < 9 - i; j++)
        {
            int t;
            if (a[j] < a[j + 1])
            {
                t = a[j];
                a[j] = a[j + 1];
                a[j + 1] = t;
            }
        }
    }
    for (i = 0; i < 10; i++)
        cout << a[i] << '\t';
    cout << "要查找的元素值：";
    cin >> x;
    m = 1;
    n = 10;
    while (m <= n)
    {
        mid = (m + n) / 2;
        if (a[mid-1] == x)
        {
            cout << "该数为降序排列后第" << mid << "个数"<<endl;
            break;
        }
        if (x > a[mid-1])
            n = mid;
        else
            m = mid;
    }
    if (m > n)
        cout << "没有找到该数" << endl;
    cout << "学号：3170608054，姓名：张飞" << endl;
    return 0;
}